/// @description Insert description here
// You can write your code in this editor

var xFollow = objPlayer.x;
var yFollow = objPlayer.y;
xFollow = floor(xFollow/view_wport[0])*view_wport[0];
yFollow = floor(yFollow/view_hport[0])*view_hport[0];
if(state == 1){
	//var last=image_xscale;
	image_xscale = x+64 < objPlayer.x ? 1 : -1;
	//if(image_xscale!=last){
	//	x = x + (image_xscale==1)? -128 : 128;
	//}
}
if(state == 2){
	//var last=image_xscale;
	image_xscale = x+64 < objPlayer.x ? 1 : -1;
	if(hspeed==0) x = temvar[? "a"]==1 ? xFollow-32 : xFollow+640-128;
	if(hspeed==0) y = objPlayer.y-64;
	//if(image_xscale!=last){
	//	x = x + (image_xscale==1)? -128 : 128;
	//}
}
if(ac > 0) ac--;

if(hp<30){
	visible = 0;
	hp = 200;
	blood=0;
	ac=-1
	temvar[? "point"]=0;
	alarm[1]=360;
	speed=0;
}